<template>
  <div class="other-categories-list">
    <div class="categories" v-for="(item,index) in otherCategories" :key="index">
      <router-link :to="{name:'productList',params:{id:item.id}}" replace>
        <img :src="item.background_image" alt="">
        <h2>{{ item.title }}</h2>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: "OtherCategoriesList",
  props: {
    otherCategories: Array
  },
  data() {
    return {}
  },
// 侦听器
  watch: {},
// 计算属性
  computed: {},
// 事件
  methods: {},
// 生命周期
  created() {
  },
  mounted() {
  }
}
</script>

<style lang="scss" scoped>
.other-categories-list {
  .categories {
    padding: 20px;
    border-bottom: 1px solid #e4e4e4;

    a {
      width: 100%;
      display: flex;
      align-items: center;

      img {
        width: 114px;
        margin-right: 20px;
      }

      h2 {
        color: #4a4a4a;
        font-size: 16px;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        word-break: break-word;

      }
    }
  }
}
</style>